Foxit PDF SDK
FoxitPDFSDKPython2.TagTreeEditor类 参考
类 FoxitPDFSDKPython2.TagTreeEditor 继承关系图:
FoxitPDFSDKPython2.Base

Public 成员函数

def TagTreeEditor (pdf_doc)
 构造函数。 更多...
 
def AddNewTag (selected_tag_id, type, title)
 向标签树添加一个新标签。 更多...
 
def AddTagForAnnotation (is_tag_annotations, annot, page_index, selected_tag_id)
 为注释添加标签。 更多...
 
def ChangeTagToArtifact (selected_tag_ids, artifact_type, artifact_to_side)
 将标签更改为人工元素。 更多...
 
def CreateTagFromSelectionByContent (selected_content_ids, selected_tag_id)
 根据内容从选中内容创建标签。 更多...
 
def CreateTagFromSelectionByElement (page_index, selected_tag_id)
 根据元素从选中内容创建标签。 更多...
 
def CreateTagFromSelectionByTag (selected_tag_ids, last_selected_tag_id)
 根据标签从选中内容创建标签。 更多...
 
def CreateTagFromSelectionByText (page_index, selected_text_rects, selected_tag_id)
 根据文本从选中内容创建标签。 更多...
 
def DeleteEmptyTags (selected_tag_ids)
 从标签树中删除空标签。 更多...
 
def DeleteTags (selected_tag_ids)
 从标签树中删除指定的标签。 更多...
 
def FindTagFromSelection (selected_tag_ids)
 根据选中内容查找标签。 更多...
 
def GetAllContents (selected_tag_id)
 获取指定标签项的所有内容。 更多...
 
def GetContentTreeItemIDsByTagItemID (selected_tag_id)
 根据标签项 ID 获取内容树项 ID。 更多...
 
def GetTagPropertyByID (item_id)
 根据标签项 ID 获取标签属性。 更多...
 
def GetTagTree ()
 获取当前 PDF 文档的标签树。 更多...
 
def GetTagTreeContextMenuItems (input_data)
 获取标签树的右键菜单项。 更多...
 
def IsEmpty ()
 检查当前对象是否为空。 更多...
 
def MoveTags (source_tag_ids, dest_tag_id, is_moved_as_child)
 在标签树中移动标签。 更多...
 
def SetDocAsTaggedPDF ()
 将当前 PDF 文档设置为已标记 PDF。 更多...
 
def SetTagPropertyActualText (item_id, actual_text)
 为指定标签项设置标签属性的实际文本。 更多...
 
def SetTagPropertyAlternateText (item_id, alternate_text)
 为指定标签项设置标签属性的替代文本。 更多...
 
def SetTagPropertyID (item_id, id)
 为指定标签项设置标签属性的 ID。 更多...
 
def SetTagPropertyLanguage (item_id, language)
 为指定标签项设置标签属性的语言。 更多...
 
def SetTagPropertyTitle (item_id, title)
 为指定标签项设置标签属性的标题。 更多...
 
def SetTagPropertyType (item_id, type)
 为指定标签项设置标签属性的类型。 更多...
 

静态 Public 属性

 e_ArtifactAttachToSideTypeBottom = _fsdk.TagTreeEditor_e_ArtifactAttachToSideTypeBottom
 人工元素附着边:底部。
 
 e_ArtifactAttachToSideTypeLeft = _fsdk.TagTreeEditor_e_ArtifactAttachToSideTypeLeft
 人工元素附着边:左侧。
 
 e_ArtifactAttachToSideTypeNone = _fsdk.TagTreeEditor_e_ArtifactAttachToSideTypeNone
 人工元素附着边:无。
 
 e_ArtifactAttachToSideTypeRight = _fsdk.TagTreeEditor_e_ArtifactAttachToSideTypeRight
 人工元素附着边:右侧。
 
 e_ArtifactAttachToSideTypeTop = _fsdk.TagTreeEditor_e_ArtifactAttachToSideTypeTop
 人工元素附着边:顶部。
 
 e_ArtifactTypeLayout = _fsdk.TagTreeEditor_e_ArtifactTypeLayout
 人工元素类型:版式人工元素(视觉版式元素)。
 
 e_ArtifactTypePage = _fsdk.TagTreeEditor_e_ArtifactTypePage
 人工元素类型:页面级人工元素。
 
 e_ArtifactTypePagination = _fsdk.TagTreeEditor_e_ArtifactTypePagination
 人工元素类型:与分页相关的人工元素(如页眉/页脚)。
 

详细描述

此类用于让用户编辑 PDF 文档的标签树(结构树):查询和修改标签 属性、添加/删除/移动标签、根据选中内容创建标签、将标签更改为人工元素以及 将文档标记为已标记 PDF。 在使用此模块中的任何类或方法之前,请确保已通过 FoxitPDFSDKPython2.Library.Initialize 函数并使用包含 "Accessibility" 模块的密钥成功初始化福昕 PDF SDK。

参见
FoxitPDFSDKPython2.Library

构造及析构函数说明

◆ TagTreeEditor()

def FoxitPDFSDKPython2.TagTreeEditor.TagTreeEditor (   pdf_doc)

构造函数。

构造函数,使用另一个标签编辑器对象构造。

参数
[in]pdf_doc有效的 PDF 文档对象。
[in]other另一个标签编辑器对象。

成员函数说明

◆ AddNewTag()

def FoxitPDFSDKPython2.TagTreeEditor.AddNewTag (   selected_tag_id,
  type,
  title 
)

向标签树添加一个新标签。

参数
[in]selected_tag_id作为父级的已选中标签 ID。
[in]type标签类型。
[in]title标签标题。
返回
更新后的标签树项数组。

◆ AddTagForAnnotation()

def FoxitPDFSDKPython2.TagTreeEditor.AddTagForAnnotation (   is_tag_annotations,
  annot,
  page_index,
  selected_tag_id 
)

为注释添加标签。

参数
[in]is_tag_annotations是否为注释添加标签。
[in]annot注释对象。
[in]page_index页面索引。有效取值范围为 0 到 (count - 1),其中 count 为函数 FoxitPDFSDKPython2.PDFDoc.GetPageCount 返回的页面总数。
[in]selected_tag_id已选中的标签 ID。
返回
更新后的标签树项数组。

◆ ChangeTagToArtifact()

def FoxitPDFSDKPython2.TagTreeEditor.ChangeTagToArtifact (   selected_tag_ids,
  artifact_type,
  artifact_to_side 
)

将标签更改为人工元素。

参数
[in]selected_tag_ids已选中的标签 ID 集合。
[in]artifact_type人工元素类型。请参考 。
[in]artifact_to_side人工元素附着边类型。 请参考 。
返回
true 表示成功,false 表示失败。

◆ CreateTagFromSelectionByContent()

def FoxitPDFSDKPython2.TagTreeEditor.CreateTagFromSelectionByContent (   selected_content_ids,
  selected_tag_id 
)

根据内容从选中内容创建标签。

参数
[in]selected_content_ids已选中的内容 ID 集合。
[in]selected_tag_id已选中的标签 ID。
返回
更新后的标签树项数组。

◆ CreateTagFromSelectionByElement()

def FoxitPDFSDKPython2.TagTreeEditor.CreateTagFromSelectionByElement (   page_index,
  selected_tag_id 
)

根据元素从选中内容创建标签。

参数
[in]page_index页面索引。有效取值范围为 0 到 (count - 1),其中 count 为函数 FoxitPDFSDKPython2.PDFDoc.GetPageCount 返回的页面总数。
[in]selected_tag_id已选中的标签 ID。
返回
更新后的标签树项数组。

◆ CreateTagFromSelectionByTag()

def FoxitPDFSDKPython2.TagTreeEditor.CreateTagFromSelectionByTag (   selected_tag_ids,
  last_selected_tag_id 
)

根据标签从选中内容创建标签。

参数
[in]selected_tag_ids已选中的标签 ID 集合。
[in]last_selected_tag_id最后一个被选中的标签 ID。
返回
更新后的标签树项数组。

◆ CreateTagFromSelectionByText()

def FoxitPDFSDKPython2.TagTreeEditor.CreateTagFromSelectionByText (   page_index,
  selected_text_rects,
  selected_tag_id 
)

根据文本从选中内容创建标签。

参数
[in]page_index页面索引。有效取值范围为 0 到 (count - 1),其中 count 为函数 FoxitPDFSDKPython2.PDFDoc.GetPageCount 返回的页面总数。
[in]selected_text_rects已选中文本的矩形集合。
[in]selected_tag_id已选中的标签 ID。
返回
更新后的标签树项数组。

◆ DeleteEmptyTags()

def FoxitPDFSDKPython2.TagTreeEditor.DeleteEmptyTags (   selected_tag_ids)

从标签树中删除空标签。

参数
[in]selected_tag_ids用于检查空标签的标签 ID 数组。
返回
更新后的标签树项数组。

◆ DeleteTags()

def FoxitPDFSDKPython2.TagTreeEditor.DeleteTags (   selected_tag_ids)

从标签树中删除指定的标签。

参数
[in]selected_tag_ids待删除标签 ID 的数组。
返回
更新后的标签树项数组。

◆ FindTagFromSelection()

def FoxitPDFSDKPython2.TagTreeEditor.FindTagFromSelection (   selected_tag_ids)

根据选中内容查找标签。

参数
[in]selected_tag_ids已选中的标签 ID 集合。
返回
找到的标签 ID 数组。

◆ GetAllContents()

def FoxitPDFSDKPython2.TagTreeEditor.GetAllContents (   selected_tag_id)

获取指定标签项的所有内容。

参数
[in]selected_tag_id已选中的标签 ID。
返回
内容文本。

◆ GetContentTreeItemIDsByTagItemID()

def FoxitPDFSDKPython2.TagTreeEditor.GetContentTreeItemIDsByTagItemID (   selected_tag_id)

根据标签项 ID 获取内容树项 ID。

参数
[in]selected_tag_id已选中的标签 ID。
返回
内容树项 ID 的数组。

◆ GetTagPropertyByID()

def FoxitPDFSDKPython2.TagTreeEditor.GetTagPropertyByID (   item_id)

根据标签项 ID 获取标签属性。

参数
[in]item_id标签项 ID,通过 FoxitPDFSDKPython2.TagTreeEditor.GetTagTree 返回的条目中的 TagTreeItemData::item_id 获取。
返回
标签属性对象。
注解
item_id 所引用的标签项必须是结构元素(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeElement )节点; 标记内容引用(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeMarkedContentSeq )、 对象引用(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeObject )等引用类节点不具有该属性,将导致调用失败。

◆ GetTagTree()

def FoxitPDFSDKPython2.TagTreeEditor.GetTagTree ( )

获取当前 PDF 文档的标签树。

返回
标签树项数组。

◆ GetTagTreeContextMenuItems()

def FoxitPDFSDKPython2.TagTreeEditor.GetTagTreeContextMenuItems (   input_data)

获取标签树的右键菜单项。

参数
[in]input_data右键菜单的输入数据。
返回
菜单项数据的数组。

◆ IsEmpty()

def FoxitPDFSDKPython2.TagTreeEditor.IsEmpty ( )

检查当前对象是否为空。

当前对象为空时,表示当前对象不可用。

返回
true 表示当前对象为空,false 表示不为空。

◆ MoveTags()

def FoxitPDFSDKPython2.TagTreeEditor.MoveTags (   source_tag_ids,
  dest_tag_id,
  is_moved_as_child 
)

在标签树中移动标签。

参数
[in]dest_tag_id目标标签 ID。
[in]is_moved_as_child是否作为目标的子项移动。
返回
更新后的标签树项数组。

◆ SetDocAsTaggedPDF()

def FoxitPDFSDKPython2.TagTreeEditor.SetDocAsTaggedPDF ( )

将当前 PDF 文档设置为已标记 PDF。

返回
true 表示成功,false 表示失败。

◆ SetTagPropertyActualText()

def FoxitPDFSDKPython2.TagTreeEditor.SetTagPropertyActualText (   item_id,
  actual_text 
)

为指定标签项设置标签属性的实际文本。

参数
[in]item_id标签项 ID,通过 FoxitPDFSDKPython2.TagTreeEditor.GetTagTree 返回的条目中的 TagTreeItemData::item_id 获取。
[in]actual_text要设置的实际文本。
返回
true 表示成功,false 表示失败。
注解
item_id 所引用的标签项必须是结构元素(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeElement )节点; 标记内容引用(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeMarkedContentSeq )、 对象引用(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeObject )等引用类节点不具有该属性,将导致调用失败。

◆ SetTagPropertyAlternateText()

def FoxitPDFSDKPython2.TagTreeEditor.SetTagPropertyAlternateText (   item_id,
  alternate_text 
)

为指定标签项设置标签属性的替代文本。

参数
[in]item_id标签项 ID,通过 FoxitPDFSDKPython2.TagTreeEditor.GetTagTree 返回的条目中的 TagTreeItemData::item_id 获取。
[in]alternate_text要设置的替代文本。
返回
true 表示成功,false 表示失败。
注解
item_id 所引用的标签项必须是结构元素(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeElement )节点; 标记内容引用(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeMarkedContentSeq )、 对象引用(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeObject )等引用类节点不具有该属性,将导致调用失败。

◆ SetTagPropertyID()

def FoxitPDFSDKPython2.TagTreeEditor.SetTagPropertyID (   item_id,
  id 
)

为指定标签项设置标签属性的 ID。

参数
[in]item_id标签项 ID,通过 FoxitPDFSDKPython2.TagTreeEditor.GetTagTree 返回的条目中的 TagTreeItemData::item_id 获取。
[in]id要设置的 ID。
返回
true 表示成功,false 表示失败。
注解
item_id 所引用的标签项必须是结构元素(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeElement )节点; 标记内容引用(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeMarkedContentSeq )、 对象引用(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeObject )等引用类节点不具有该属性,将导致调用失败。

◆ SetTagPropertyLanguage()

def FoxitPDFSDKPython2.TagTreeEditor.SetTagPropertyLanguage (   item_id,
  language 
)

为指定标签项设置标签属性的语言。

参数
[in]item_id标签项 ID,通过 FoxitPDFSDKPython2.TagTreeEditor.GetTagTree 返回的条目中的 TagTreeItemData::item_id 获取。
[in]language要设置的语言。
返回
true 表示成功,false 表示失败。
注解
item_id 所引用的标签项必须是结构元素(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeElement )节点; 标记内容引用(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeMarkedContentSeq )、 对象引用(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeObject )等引用类节点不具有该属性,将导致调用失败。

◆ SetTagPropertyTitle()

def FoxitPDFSDKPython2.TagTreeEditor.SetTagPropertyTitle (   item_id,
  title 
)

为指定标签项设置标签属性的标题。

参数
[in]item_id标签项 ID,通过 FoxitPDFSDKPython2.TagTreeEditor.GetTagTree 返回的条目中的 TagTreeItemData::item_id 获取。
[in]title要设置的标签标题。
返回
true 表示成功,false 表示失败。
注解
item_id 所引用的标签项必须是结构元素(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeElement )节点; 标记内容引用(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeMarkedContentSeq )、 对象引用(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeObject )等引用类节点不具有该属性,将导致调用失败。

◆ SetTagPropertyType()

def FoxitPDFSDKPython2.TagTreeEditor.SetTagPropertyType (   item_id,
  type 
)

为指定标签项设置标签属性的类型。

参数
[in]item_id标签项 ID,通过 FoxitPDFSDKPython2.TagTreeEditor.GetTagTree 返回的条目中的 TagTreeItemData::item_id 获取。
[in]type要设置的标签类型。
返回
true 表示成功,false 表示失败。
注解
item_id 所引用的标签项必须是结构元素(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeElement )节点; 标记内容引用(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeMarkedContentSeq )、 对象引用(FoxitPDFSDKPython2.TagTreeItemData.e_TagNodeTypeObject )等引用类节点不具有该属性,将导致调用失败。